/* @(#)DecoratorCompletionProgress.java
** 
** Copyright (C) 2012 by Steven D. Stamps
**
**             Trademarks & Copyrights
** Flywheel Management Science(TM), Flywheel Management Model(TM),
** Flywheel Story Editor(TM) and FlywheelMS(TM) are exclusive trademarks
** of Steven D. Stamps and may only be used freely for the purpose of
** identifying the unforked version of this software.  Subsequent forks
** may not use these trademarks.  All other rights are reserved.
** and FlywheelMS(TM) are exclusive trademarks of Steven D. Stamps
** and may only be used freely for the purpose of identifying the
** unforked version of this software.  Subsequent forks (if any) may
** not use these trademarks.  All other rights are reserved.
**
** DecKanGL (Decorated Kanban Glyph Language) and TribKn (Tribal Knowledge)
** are also exclusive trademarks of Steven D. Stamps.  These may be used
** freely within the unforked FlywheelMS application and documentation.
** All other rights are reserved.
**
** gConGUI (game Controller Graphical User Interface) is an exclusive
** trademark of Steven D. Stamps.  This trademark may be used freely
** within the unforked FlywheelMS application and documentation.
** All other rights are reserved.
**
** Trademark information is available at
** <http://www.flywheelms.com/trademarks>
**
** Flywheel Management Science(TM) is a copyrighted body of management
** metaphors, governance processes, and leadership techniques that is
** owned by Steven D. Stamps.  These copyrighted materials may be freely
** used, without alteration, by the community (users and developers)
** surrounding this GPL3-licensed software.  Additional copyright
** information is available at <http://www.flywheelms.org/copyrights>
**
**              GPL3 Software License
** This program is free software: you can use it, redistribute it and/or
** modify it under the terms of the GNU General Public License, version 3,
** as published by the Free Software Foundation. This program is distributed
** in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
** even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
** PURPOSE.  See the GNU General Public License for more details. You should
** have received a copy of the GNU General Public License, in a file named
** COPYING, along with this program.  If you cannot find your copy, see
** <http://www.gnu.org/licenses/gpl-3.0.html>.
*/

package com.flywheelms.library.fmm.deckangl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.graphics.drawable.Drawable;

import com.flywheelms.library.FmsLibraryApplication;
import com.flywheelms.library.R;
import com.flywheelms.library.deckangl.enumerator.DecoratorColor;
import com.flywheelms.library.deckangl.glyph.DecoratorEnumeration;
import com.flywheelms.library.deckangl.glyph.TribKnQualityMetric;

public class DecoratorCompletion extends DecoratorEnumeration {
	
	protected static DecoratorCompletion staticInstance = new DecoratorCompletion();
	
	protected static TribKnQualityMetric tribKnQualityMetric;
	static {
		tribKnQualityMetric = FmmDecKanGlDictionary.getInstance().getTribKn(
				FmmDecKanGlDictionary.tribKn_COMPLETION );
	}
	
	public static DecoratorCompletion COMPLETION_NOT_SCHEDULED = new DecoratorCompletion(
			"Completion Not Scheduled",
			R.string.decorator__completion_progress__not_scheduled,
			R.integer.decorator__completion_progress__not_scheduled__quality_index,
			DecoratorColor.RED );
	public static DecoratorCompletion TIMELY_COMPLETION_AT_RISK = new DecoratorCompletion(
			"Timely Completion At Risk",
			R.string.decorator__completion_progress__at_risk,
			R.integer.decorator__completion_progress__at_risk__quality_index,
			DecoratorColor.ORANGE );
	public static DecoratorCompletion UNCONFIRMED_COMPLETION = new DecoratorCompletion(
			"Unconfirmed Completion",
			R.string.decorator__completion_progress__unconfirmed,
			R.integer.decorator__completion_progress__unconfirmed__quality_index,
			DecoratorColor.PINK );
	public static DecoratorCompletion NO_COMPLETION_ISSUES = new DecoratorCompletion(
			"No Completion Issues",
			R.string.decorator__completion_progress__no_issues,
			R.integer.decorator__completion_progress__no_issues__quality_index,
			DecoratorColor.TRANSPARENT );
	public static DecoratorCompletion COMPLETION_PAST_DUE = new DecoratorCompletion(
			"Completion is Past Due",
			R.string.decorator__completion_progress__past_due,
			R.integer.decorator__completion_progress__past_due__quality_index,
			DecoratorColor.BLUE );
	public static DecoratorCompletion UNSPECIFIED_COMPLETION_QUALITY = new DecoratorCompletion(
			"Unspecified Completion Quality",
			R.string.decorator__completion_progress__unspecified_quality,
			R.integer.decorator__completion_progress__unspecified_quality__quality_index,
			DecoratorColor.GRAY );
	public static DecoratorCompletion COMPLETION_QUALITY_NOT_ENABLED = new DecoratorCompletion(
			"Completion Quality Not Enabled",
			R.string.decorator__completion_progress__not_enabled,
			R.integer.decorator__completion_progress__not_enabled__quality_index,
			DecoratorColor.DISABLED );
	
	protected static ArrayList<DecoratorEnumeration> valuesList =
			new ArrayList<DecoratorEnumeration>();
	static {
		valuesList.add(COMPLETION_NOT_SCHEDULED);
		valuesList.add(TIMELY_COMPLETION_AT_RISK);
		valuesList.add(UNCONFIRMED_COMPLETION);
		valuesList.add(NO_COMPLETION_ISSUES);
		valuesList.add(COMPLETION_PAST_DUE);
		valuesList.add(UNSPECIFIED_COMPLETION_QUALITY);
		valuesList.add(COMPLETION_QUALITY_NOT_ENABLED);
	}
	
	protected static HashMap<String, DecoratorCompletion> nameMap = new HashMap<String, DecoratorCompletion>();
	static {
		DecoratorCompletion.nameMap.put(COMPLETION_NOT_SCHEDULED.getName(), COMPLETION_NOT_SCHEDULED);
		DecoratorCompletion.nameMap.put(TIMELY_COMPLETION_AT_RISK.getName(), TIMELY_COMPLETION_AT_RISK);
		DecoratorCompletion.nameMap.put(UNCONFIRMED_COMPLETION.getName(), UNCONFIRMED_COMPLETION);
		DecoratorCompletion.nameMap.put(NO_COMPLETION_ISSUES.getName(), NO_COMPLETION_ISSUES);
		DecoratorCompletion.nameMap.put(COMPLETION_PAST_DUE.getName(), COMPLETION_PAST_DUE);
		DecoratorCompletion.nameMap.put(UNSPECIFIED_COMPLETION_QUALITY.getName(), UNSPECIFIED_COMPLETION_QUALITY);
		DecoratorCompletion.nameMap.put(COMPLETION_QUALITY_NOT_ENABLED.getName(), COMPLETION_QUALITY_NOT_ENABLED);
	}
	
	public static DecoratorCompletion getObjectForName(String aName) {
		return DecoratorCompletion.nameMap.get(aName);
	}
	
	private DecoratorCompletion() {
		super();
	}
	
	public static DecoratorCompletion getStaticInstance() {
		return staticInstance;
	}
	
	public DecoratorCompletion(
			String aName,
			int aDescriptionResourceId,
			int aTribKnQualityIndexResourceId,
			DecoratorColor aDecKanGlDecoratorColor ) {
		super (aName, aDescriptionResourceId, aTribKnQualityIndexResourceId, aDecKanGlDecoratorColor);
	}
	
	public static List<DecoratorEnumeration> values() {
		return valuesList;
	}

	@Override
	public TribKnQualityMetric getTribKnQualityMetric() {
		return tribKnQualityMetric;
	}

	@Override
	public String getLabelText() {
		return FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__completion);
	}

	@Override
	public Drawable getLabelDrawable() {
		return FmsLibraryApplication.getContext().getResources().getDrawable(R.drawable.tribkn_quality_metric__completion);
	}

}